package com.cskaoyan.controller.wx.goods;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.wxgoodsvo.WxHomeIndexVo;
import com.cskaoyan.bean.vo.wxgoodsvo.WxMarketConfigVo;
import com.cskaoyan.service.wx.goodsService.WxHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @Description:todo 用于对首页商品的展示
* @Author:todo wang xv
* @Date:todo 2022/11/22
*/
@RestController
@RequestMapping("wx/home")
public class WxHomeController {

    @Autowired
    WxHomeService wxHomeService;


    /**
    * @Description:todo
    * @Author:todo wang xv
    * @Date:todo 2022/11/22
    */

    @RequestMapping("index")
    public BaseRespVo queryHomeIndex(){
       WxHomeIndexVo indexVo = wxHomeService.queryHomeIndex();
       return BaseRespVo.succeed(indexVo);
    }

    /**
    * @Description:todo 显示小程序商城的配置
    * @Author:todo wang xv
    * @Date:todo 2022/11/24
    */
    @RequestMapping("about")
    public BaseRespVo queryMarketConfig(){
       WxMarketConfigVo marketConfigVo = wxHomeService.queryMarketConfig();
       return BaseRespVo.succeed(marketConfigVo);
    }
}
